﻿namespace Bilibili.Model.Live
{
    public sealed class LiveSearchModel
    {
        public int code { get; set; }
        public string message { get; set; }
        public string type { get; set; }
        public int uid { get; set; }
        public int short_id { get; set; }
        public string tags { get; set; }
        public int online { get; set; }
        public string uname { get; set; }
        public string Uname
        {
            get
            {
                return uname.Replace("<em class=\"keyword\">", "").Replace("</em>", "");
            }
        }
        public string uface { get; set; }
        public string face
        {
            get
            {
                if (!uface.StartsWith("http"))
                    return "https:" + uface;
                return uface;
            }
        }
        public string cover { get; set; }
        public string _cover
        {
            get
            {
                if (!cover.StartsWith("http"))
                    return "https:" + cover;
                return cover;
            }
        }
        public string title { get; set; }
        public string Title
        {
            get
            {
                return title?.Replace("<em class=\"keyword\">", "").Replace("</em>", "");
            }
        }
        public string user_cover { get; set; }
        public int roomid { get; set; }
        public int attentions { get; set; }
        public string FansNum
        {
            get
            {
                if (attentions > 10000)
                    return ((double)attentions / 10000).ToString("0.0" + "万");
                else
                    return attentions.ToString();
            }
        }
        public int live_status { get; set; }
        public bool liveing
        {
            get
            {
                return live_status == 1;
            }
        }
        public bool stop
        {
            get
            {
                return live_status != 1;
            }
        }
    }
}